<template>
  <footer class="footer">
    <span class="todo-count"
      >剩余<strong>{{ count }}</strong></span
    >
    <ul class="filters" @click="$emit('switch-todo', type)">
      <li>
        <a
          href="javascript:;"
          :class="{ selected: type === 'all' }"
          @click="type = 'all'"
          >全部</a
        >
      </li>
      <li>
        <a
          href="javascript:;"
          :class="{ selected: type === 'no' }"
          @click="type = 'no'"
          >未完成</a
        >
      </li>
      <li>
        <a
          href="javascript:;"
          :class="{ selected: type === 'yes' }"
          @click="type = 'yes'"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed">清除已完成</button>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      type: "arr",
    };
  },
  props: ["footArr"],
  computed: {
    count() {
      return this.footArr.length;
    },
  },
  
};
</script>